<?php
class search extends Controller
{
		function __constructor()
	{
		parent::__constructor();
	}
	
	//--
	function index()
	{
		$this->load->view("search/index");
	}
	
	function seach_global()
	{
		$this->load->model("service_search");	
		$term = $this->uri->segment(3);
		
		$data = array();
		$data['clients'] = $this->service_search->simpleSearch('company',$term);
		$data['jobs'] = $this->service_search->simpleSearch('job',$term);

		$this->load->view("search/index", $data);
	}
	
	function search_job($s)
	{
		$this->load->model("job");
		is_logged_in();
		$str = $s;
		$r= "";
		if($str != "")
		{
			$r = $this->service_search->simpleSearch("job",$str);
			$data['searchs']= $r;
		}
			$this->load->view("job/search", $data);
	}
	
	function search_client($s)
	{
		$this->load->model("company");
		is_logged_in();
		$str = $s;
		$r= "";

		if($str != "")
		{
			$r = $this->service_search->simpleSearch("company",$str);
			$data['searchs']= $r;
		}
			$this->load->view("client/search", $data);
	}

}